#include <Arduino.h>
#include "image.cpp"
#include "screen.h"
#include "state.h"
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>屏幕
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, 5, 4); //rst sck sda
void ScreenInit() {
  u8g2.begin();
  //u8g2.setDisplayRotation(U8G2_R2);
  u8g2.setFont(u8g2_font_ncenB08_tr);
  DrawEmoji(pig);
}
void DrawEmoji(const uint8_t *bitmap) {
  u8g2.clearBuffer();                            // 清空缓冲区
  u8g2.drawXBMP(0, 0, 128, 64, bitmap);          // 直接绘图
  u8g2.sendBuffer();                             // 一次性发送到屏幕
}
void ScreenClear() {
  u8g2.clearDisplay();
}
void ShowNotConnected(int state) {
  u8g2.clearBuffer();
  if(state == 0) {
    u8g2.drawStr(0,32,"Wifi Not Connected");
  } else {
    u8g2.drawStr(0,32,"Remote Not Connected");
  }
  u8g2.sendBuffer();        
}

void ShowFlightData() {

}

void Moe() {
    DrawEmoji(moe);
}

void Dead() {
    DrawEmoji(dead);
}

void Pig() {
  DrawEmoji(pig);
}

void Emm() {
  DrawEmoji(emm);
}